/**竞赛相关接口 */
import { httpRequest } from '@/http/request'
import { params } from '@/types/common'
import { CompetitionApplicationData, CompetitionPostData } from '@/types/competition'
/**增加竞赛信息 */
export const addCompetitionService = (data: CompetitionPostData) => {
  return httpRequest({
    url: '/competition/add',
    method: 'post',
    data,
  })
}
/**
 * 获取竞赛信息
 */
export const getCompetitionService = (id: string | number) => {
  return httpRequest<CompetitionPostData>({
    url: '/competition/getCompetitionInfo',
    method: 'post',
    data: { id },
  })
}
/**
 * 分页获取竞赛信息
 */
export const getCompetitionPageService = (data: params) => {
  return httpRequest<CompetitionApplicationData[]>({
    url: '/competition/pageQuery',
    method: 'post',
    data,
  })
}
